public class TestPersion
{
	public static void main(String args[])
	{
		Persion p1 = new Persion("marry",20);
		Persion p2 = new Persion("smith",30);

		System.out.println(p1.compareTo(p2));
	}
}

class Persion
{
	String name;
	int age;

	public Persion(String name,int age)
	{
		this.name = name;
		this.age = age;
	}

	public boolean compareTo(Persion p)
	{
		return this.name.equals(p.name) && this.age == p.age;
	}
}